﻿using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp;
using Xms.Abp.AspNetCore.Mvc;

namespace IdentityManagement
{
    [RemoteService(Name = IdentityRemoteServiceConsts.RemoteServiceName)]
    [Area(IdentityRemoteServiceConsts.ModuleName)]
    [ControllerName("Role")]
    [Route("api/management/identity/roles")]
    public class IdentityRoleController : XmsCrudController<IIdentityRoleAppService, IdentityRoleResult, Guid, IdentityRolePagedParameter, IdentityRoleCreateParameter, IdentityRoleUpdateParameter>, IIdentityRoleAppService
    {
        protected IIdentityRoleAppService RoleAppService { get; }

        public IdentityRoleController(IIdentityRoleAppService roleAppService)
        {
            RoleAppService = roleAppService;
        }

        [HttpGet]
        [Route("all")]
        public virtual async Task<List<IdentityRoleResult>> GetAllListAsync()
            => await RoleAppService.GetAllListAsync();
    }
}
